package cn.edu.scau.cmi.chenkairong.ioc.Test;

import cn.edu.scau.cmi.chenkairong.ioc.domain.Student;
import cn.edu.scau.cmi.chenkairong.ioc.domain.Teacher;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Demo {
    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("applicationContext.xml");
        Student student = (Student)applicationContext.getBean("student1");
        Teacher teacher = (Teacher)applicationContext.getBean("teacher1");
        System.out.println(student.getName());
        System.out.println(teacher.getName());
    }
}
